from abc import ABC, abstractmethod
from typing import Generic, TypeVar

from ..repositories import BaseRepository

T = TypeVar('T')
R = TypeVar('R', bound=BaseRepository)

class BaseService(ABC, Generic[T, R]):
    def __init__(self, repository: R):
        self.repository = repository

    @abstractmethod
    def create(self, data: dict) -> T:
        pass

    @abstractmethod
    def get_by_id(self, id: int) -> T:
        pass